home *** CD-ROM | disk | FTP | other *** search
- #include "stdio.h"
- #include "stdlib.h"
- #include "string.h"
- #include "ctype.h"
- #include "werr.h"
- #include "bbc.h"
-
- #define mtnl 50
- #define mcl 8
-
- extern struct std {
- char town[mtnl];
- char code[mcl];
- struct std *next;
- struct std *previous;
- } *stdstart,*stdlast;
-
- extern int modified;
-
- void delete_entry(char *town,char *code)
- {
- struct std *stdnode;
- stdnode = stdstart;
-
- while (stdnode) {
- if (!strcmp(stdnode->town,town)) { /* do an exact match */
- if (!strcmp(stdnode->code,code)) { /* if here then is a match */
- if (stdnode->previous) stdnode->previous->next = stdnode->next;
- else { /* new first item */
- stdstart = stdnode->next;
- if (stdstart) stdstart->previous = NULL;
- }
- if (stdnode->next) stdnode->next->previous = stdnode->previous;
- free (stdnode);
- }
- }
- stdnode = stdnode->next;
- }
- modified++;
- bbc_vdu(7);
- }
-